﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Microsoft.Practices.Unity;

namespace UnityStudy
{
    class GenericStudy
    {
        public static void Test()
        {
            var container = new UnityContainer();
            container.RegisterType(typeof(IRepository<>), typeof(Repository<>));
            container.RegisterType(typeof(IUnitOfWork), typeof(UnitOfWork));

            Console.WriteLine(container.Resolve<IRepository<int>>());
            Console.WriteLine(container.Resolve<IRepository<float>>());
        }
    }

    interface IRepository<T> { }

    interface IUnitOfWork { }

    class Repository<T> : IRepository<T>
    {
        public Repository(IUnitOfWork unitofwork) { }
    }

    class UnitOfWork : IUnitOfWork { }
}
